package acm.pta10;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class 合法密码 {
    public static void main(String[] args) {
        Reader sc = new Reader();
        int n = sc.nextInt();
        while (n-- > 0) {
            String line = sc.nextLine();
            if (line.length() < 6) {
                System.out.println("Your password is tai duan le.");
                continue;
            }
            if (!line.matches("[a-zA-Z0-9.]+")) {
                System.out.println("Your password is tai luan le.");
                continue;
            }
            if (!line.matches(".*[A-Za-z].*")) {
                System.out.println("Your password needs zi mu.");
                continue;
            }
            if (!line.matches(".*\\d.*")) {
                System.out.println("Your password needs shu zi.");
                continue;
            }
            System.out.println("Your password is wan mei.");
        }
    }
    static
    class Reader {
        private BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        private StringTokenizer tokenizer = new StringTokenizer("");

        private String innerNextLine() {
            try {
                return reader.readLine();
            } catch (IOException ex) {
                return null;
            }
        }

        public boolean hasNext() {
            while (!tokenizer.hasMoreTokens()) {    //内存中没有
                String nextLine = innerNextLine();
                if (nextLine == null) {     //且没有下一行
                    return false;
                }
                tokenizer = new StringTokenizer(nextLine);  //读入一行
            }
            return true;
        }

        public String nextLine() {
            tokenizer = new StringTokenizer("");    //清空内存中的字符
            return innerNextLine();
        }

        public String next() {
            hasNext();
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble(){
            return Double.parseDouble(next());
        }
//    public BigInteger nextBigInt() {
//        return new BigInteger(next());
//    }
    }

}
